package cn.sjx.auth.listener;


import cn.sjx.auth.service.PermissionService;

import javax.annotation.Resource;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * 项目一启动就运行 用监听器
 *  ServletContextListener 就是用来监听tomcat的 tomcat一启动就运行方法
 *  要加上@WebListener才说明是监听类，还要在启动类上加上扫描
 */
@WebListener
public class InitListener implements ServletContextListener {

    @Resource
    private PermissionService permissionService;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        //permissionService.scan();

    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
